#!/bin/bash

BOCHS=$1
if [ -z "${BOCHS}" ]; then
    BOCHS="bochs-2.7"
fi

SRC_ROOT=`pwd`

if [ ! -f ${SRC_ROOT}/configs/${BOCHS}.config ]; then
    echo "ERROR: bochs config file ${SRC_ROOT}/configs/${BOCHS}.config not found"
    exit -1
fi

if [ ! -f ${SRC_ROOT}/out/bxImage/vdisk.img ]; then
    echo "ERROR; bochs disk image ${SRC_ROOT}/out/bximage/vdisk.img not found"
    exit -1
fi

bochs -f ${SRC_ROOT}/configs/${BOCHS}.config